
const AutoImport = require('unplugin-auto-import/webpack')
const Components = require('unplugin-vue-components/webpack')
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')

//加入
module.exports = {
  // ...
  transpileDependencies: true,
  publicPath: process.env.BASE_URL,
  configureWebpack: {
    plugins: [
      AutoImport({
        resolvers: [ElementPlusResolver()],
      }),
      Components({
        resolvers: [ElementPlusResolver()],
      })
    ],
    externals: {
      AWSC: 'AWSC'
    }
  },
  css: {
    loaderOptions: {
      scss: {
        additionalData: `
        @import "@/styles/mixin.scss";
        @import "@/styles/components.scss";
        `
      }
    }
  },
  devServer: {
    // disableHostCheck: true,
    port:8092,
    proxy: {
        '/admin_api': {
            target: process.env.VUE_APP_BASE_API,
            changeOrigin: true,
            ws: true,
            pathRewrite: {
                '^/admin_api': ''
            },
            onProxyReq(proxyReq){
              proxyReq.removeHeader('origin') 
            }
        },
        '/vr_data_api': {
            target: 'http://foxhcs-alpha.foxtest.net/',
            ws: true,
            changeOrigin: true,
            pathRewrite: {
              '^/api': '/api'
            }
        }
    }
  }
}
